#pragma once
#include"HashTable.h"

namespace to_use
{
	template<class K,class V>
	class unordered_map
	{
	public:
		struct MapKeyOfT
		{
			const K& operator()(const std::pair<K, V>& kv)
			{
				return kv.first;
			}
		};

		typedef typename HashTable<K, std::pair<K, V>, MapKeyOfT, HashFunc<K>>::iterator iterator;

		iterator begin()
		{
			return hash.begin();
		}

		iterator end()
		{
			return hash.end();
		}

		bool insert(const std::pair<K, V>&kv)
		{
			return hash.insert(kv);
		}

	private:
		HashTable<K, std::pair<K, V>, MapKeyOfT>hash;
	};
}